module Fighter {
	/**
	 * 拥有加速技能的飞机子类---刘伟
	 */
	export class PlaneAddSpeed extends BasicFly {
		/**加速所有飞机 */
		private addAllSpeed(flyList: BasicFly[]) {
			for (let i = 0; i < flyList.length; i++) {
				let fly = flyList[i];
				fly.speed = GameUtil.PlayerMessage.createMsg().planeConfig[this.type].speed + 2;
			}
		}
		/**恢复原来速度 */
		private backSpeed(flyList: BasicFly[]) {
			for (let i = 0; i < flyList.length; i++) {
				let fly = flyList[i];
				fly.speed = GameUtil.PlayerMessage.createMsg().planeConfig[this.type].speed;
			}
		}
		/**每帧运行 */
		public update(deltaTime) {
			super.update(deltaTime);
			this.addAllSpeed(this.flyManager.productflys);
		}
		/**飞机销毁 */
		public destroy() {
			this.flyManager.destoryOneFly(this.id);
			if (this.fly.parent) {
				this.fly.parent.removeChild(this.fly);
				this.progress.parent.removeChild(this.progress);
				//GameUtil.GamePools.creatGamePools().reclaim(this);
				this.backSpeed(this.flyManager.productflys);
			}
			GameUtil.PlayerMessage.instance.AllPlaneCount--;
		}


	}
}